package com.ty.day5;

import java.util.*;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/28 9:38
 */
public class MapDemo01 {
    public static void main(String[] args) {
        HashMap<String, Set<String>> map = new HashMap<>();
        Set<String> name = new HashSet<>();
        name.add("鸡哥");
        name.add("冲击波");
        name.add("吉儿阳");
        map.put("嫌疑人",name);
        Set<String> country = new HashSet<>();
        country.add("小日子");
        country.add("泡菜");
        country.add("M国");
        map.put("国家",country);
        System.out.println(map.get("嫌疑人"));
        System.out.println(map);
        HashMap<String, Integer> map1 = new HashMap<>();
        map1.put("语文",100);
        map1.put("数学",90);
        map1.put("英语",92);
        map1.put("物理",94);
        System.out.println(map1.get("语文"));
        Set<Map.Entry<String, Integer>> entrySet = map1.entrySet();
        entrySet.forEach((x)->{
            System.out.println(x.getKey()+"--"+x.getValue());
        });
        System.out.println(map1.containsKey("语文"));
        map1.remove("数学");
        System.out.println(map1);
    }
}
